package com.imooc.service.impl;

import com.imooc.mapper.CarouselMapper;
import com.imooc.mapper.StuMapper;
import com.imooc.pojo.Carousel;
import com.imooc.pojo.Stu;
import com.imooc.service.CarouselService;
import com.imooc.service.StuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**
 * @author: ldk
 * 描述: TODO
 */
@Service
public class CarouselServiceImpl implements CarouselService {

    @Autowired
    public CarouselMapper carouselMapper;


    @Override
    public List<Carousel> queryAll(Integer isShow) {
        Example carousel = new Example(Carousel.class);
        carousel.orderBy("sort").desc();
        Example.Criteria criteria = carousel.createCriteria();
        criteria.andEqualTo("isShow", isShow);
        List<Carousel> result =carouselMapper.selectByExample(carousel);
        return result;
    }
}
